<!doctype html>
<html class="default no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>MIDIPlayer | @magenta/music</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
	<div class="tsd-page-toolbar">
		<div class="container">
			<div class="table-wrap">
				<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
					<div class="field">
						<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
						<input id="tsd-search-field" type="text" />
					</div>
					<ul class="results">
						<li class="state loading">Preparing search index...</li>
						<li class="state failure">The search index is not available</li>
					</ul>
					<a href="../index.html" class="title">@magenta/music</a>
				</div>
				<div class="table-cell" id="tsd-widgets">
					<div id="tsd-filter">
						<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
						<div class="tsd-filter-group">
							<div class="tsd-select" id="tsd-filter-visibility">
								<span class="tsd-select-label">All</span>
								<ul class="tsd-select-list">
									<li data-value="public">Public</li>
									<li data-value="protected">Public/Protected</li>
									<li data-value="private" class="selected">All</li>
								</ul>
							</div>
							<input type="checkbox" id="tsd-filter-inherited" checked />
							<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
							<input type="checkbox" id="tsd-filter-only-exported" />
							<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
						</div>
					</div>
					<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
				</div>
			</div>
		</div>
	</div>
	<div class="tsd-page-title">
		<div class="container">
			<ul class="tsd-breadcrumb">
				<li>
					<a href="../globals.html">Globals</a>
				</li>
				<li>
					<a href="../modules/_core_player_.html">&quot;core/player&quot;</a>
				</li>
				<li>
					<a href="_core_player_.midiplayer.html">MIDIPlayer</a>
				</li>
			</ul>
			<h1>Class MIDIPlayer</h1>
		</div>
	</div>
</header>
<div class="container container-main">
	<div class="row">
		<div class="col-8 col-content">
			<section class="tsd-panel tsd-comment">
				<div class="tsd-comment tsd-typography">
					<div class="lead">
						<p>A <code>NoteSequence</code> player that uses a MIDI output for playing. Note that
							WebMIDI is not supported in all browsers. A
							<a href="https://cwilso.github.io/WebMIDIAPIShim/">polyfill</a> exists, but it too
							requires a plugin to be installed on the user&#39;s computer, so it might not
						work in all cases.</p>
					</div>
					<p>If you want to use a particular MIDI output port, you must update the
						<code>output</code> property before calling <code>start</code>, otherwise a message will be sent to
					all connected MIDI outputs:</p>
					<p>Example (easy mode):</p>
					<pre><code>   const <span class="hljs-built_in">player</span> = new mm.MIDIPlayer();
   <span class="hljs-built_in">player</span>.requestMIDIAccess().<span class="hljs-keyword">then</span>(() =&gt; {
     <span class="hljs-comment">// For example, use only the first port. If you omit this,</span>
     <span class="hljs-comment">// a message will be sent to all ports.</span>
     <span class="hljs-built_in">player</span>.outputs = [<span class="hljs-built_in">player</span>.availableOutputs[<span class="hljs-number">0</span>]];
     <span class="hljs-built_in">player</span>.start(seq);
   })</code></pre><p>You can also explicitly request MIDI access outside of the player, in
					your application, and just update the <code>output</code> property before playing:</p>
					<p>Example (advanced mode):</p>
					<pre><code>   navigator.requestMIDIAccess().then(<span class="hljs-function">(<span class="hljs-params">midi</span>) =&gt;</span> {
      <span class="hljs-comment">// Get all the MIDI outputs to show them in a &lt;select&gt; (for example)</span>
      <span class="hljs-keyword">const</span> availableOutputs = [];
      <span class="hljs-keyword">const</span> it = midi.outputs.values();
      <span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> o = it.next(); o &amp;&amp; !o.done; o = it.next()) {
         availableOutputs.push(o.value);
      }
      <span class="hljs-comment">// Populate the &lt;select&gt;</span>
      <span class="hljs-keyword">const</span> el = <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">'select'</span>);
      el.innerHTML = availableOutputs.map(<span class="hljs-function"><span class="hljs-params">i</span> =&gt;</span>
          <span class="hljs-string">`&lt;option&gt;<span class="hljs-subst">${i.name}</span>&lt;/option&gt;`</span>).join(<span class="hljs-string">''</span>);

      <span class="hljs-comment">// Use the selected output port.</span>
      player = <span class="hljs-keyword">new</span> mm.MIDIPlayer();
      player.outputs = [availableOutputs[el.selectedIndex]];
      player.start(seq)
    });</code></pre>
				</div>
			</section>
			<section class="tsd-panel tsd-hierarchy">
				<h3>Hierarchy</h3>
				<ul class="tsd-hierarchy">
					<li>
						<a href="_core_player_.baseplayer.html" class="tsd-signature-type">BasePlayer</a>
						<ul class="tsd-hierarchy">
							<li>
								<span class="target">MIDIPlayer</span>
							</li>
						</ul>
					</li>
				</ul>
			</section>
			<section class="tsd-panel-group tsd-index-group">
				<h2>Index</h2>
				<section class="tsd-panel tsd-index-panel">
					<div class="tsd-index-content">
						<section class="tsd-index-section ">
							<h3>Constructors</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a href="_core_player_.midiplayer.html#constructor" class="tsd-kind-icon">constructor</a></li>
							</ul>
						</section>
						<section class="tsd-index-section ">
							<h3>Properties</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-property tsd-parent-kind-class"><a href="_core_player_.midiplayer.html#availableoutputs" class="tsd-kind-icon">available<wbr>Outputs</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="_core_player_.midiplayer.html#callbackobject" class="tsd-kind-icon">callback<wbr>Object</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="_core_player_.midiplayer.html#currentpart" class="tsd-kind-icon">current<wbr>Part</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="_core_player_.midiplayer.html#desiredqpm" class="tsd-kind-icon">desiredQPM</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class"><a href="_core_player_.midiplayer.html#outputs" class="tsd-kind-icon">outputs</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="_core_player_.midiplayer.html#playclick" class="tsd-kind-icon">play<wbr>Click</a></li>
								<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="_core_player_.midiplayer.html#scheduledstop" class="tsd-kind-icon">scheduled<wbr>Stop</a></li>
							</ul>
						</section>
						<section class="tsd-index-section ">
							<h3>Methods</h3>
							<ul class="tsd-index-list">
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_core_player_.midiplayer.html#getplaystate" class="tsd-kind-icon">get<wbr>Play<wbr>State</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_core_player_.midiplayer.html#isplaying" class="tsd-kind-icon">is<wbr>Playing</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_core_player_.midiplayer.html#pause" class="tsd-kind-icon">pause</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-protected"><a href="_core_player_.midiplayer.html#playnote" class="tsd-kind-icon">play<wbr>Note</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class"><a href="_core_player_.midiplayer.html#playnotedown" class="tsd-kind-icon">play<wbr>Note<wbr>Down</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class"><a href="_core_player_.midiplayer.html#playnoteup" class="tsd-kind-icon">play<wbr>Note<wbr>Up</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class"><a href="_core_player_.midiplayer.html#requestmidiaccess" class="tsd-kind-icon">requestMIDIAccess</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_core_player_.midiplayer.html#resume" class="tsd-kind-icon">resume</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_core_player_.midiplayer.html#resumecontext" class="tsd-kind-icon">resume<wbr>Context</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_core_player_.midiplayer.html#settempo" class="tsd-kind-icon">set<wbr>Tempo</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_core_player_.midiplayer.html#start" class="tsd-kind-icon">start</a></li>
								<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="_core_player_.midiplayer.html#stop" class="tsd-kind-icon">stop</a></li>
							</ul>
						</section>
					</div>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Constructors</h2>
				<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite">
					<a name="constructor" class="tsd-anchor"></a>
					<h3>constructor</h3>
					<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite">
						<li class="tsd-signature tsd-kind-icon">new MIDIPlayer<span class="tsd-signature-symbol">(</span>callbackObject<span class="tsd-signature-symbol">?: </span><a href="_core_player_.baseplayercallback.html" class="tsd-signature-type">BasePlayerCallback</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_core_player_.midiplayer.html" class="tsd-signature-type">MIDIPlayer</a></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Overrides <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#constructor">constructor</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L630">core/player.ts:630</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>  <code>MIDIPlayer</code> constructor.</p>
								</div>
								<p>  @param callbackObject An optional BasePlayerCallback, specifies an
									object that contains run() and stop() methods to invode during
								playback.</p>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> callbackObject: <a href="_core_player_.baseplayercallback.html" class="tsd-signature-type">BasePlayerCallback</a></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <a href="_core_player_.midiplayer.html" class="tsd-signature-type">MIDIPlayer</a></h4>
						</li>
					</ul>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Properties</h2>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
					<a name="availableoutputs" class="tsd-anchor"></a>
					<h3>available<wbr>Outputs</h3>
					<div class="tsd-signature tsd-kind-icon">available<wbr>Outputs<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">MIDIOutput</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> =&nbsp;[]</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L628">core/player.ts:628</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
					<a name="callbackobject" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagProtected">Protected</span> callback<wbr>Object</h3>
					<div class="tsd-signature tsd-kind-icon">callback<wbr>Object<span class="tsd-signature-symbol">:</span> <a href="_core_player_.baseplayercallback.html" class="tsd-signature-type">BasePlayerCallback</a></div>
					<aside class="tsd-sources">
						<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#callbackobject">callbackObject</a></p>
						<ul>
							<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L69">core/player.ts:69</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
					<a name="currentpart" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagProtected">Protected</span> current<wbr>Part</h3>
					<div class="tsd-signature tsd-kind-icon">current<wbr>Part<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
					<aside class="tsd-sources">
						<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#currentpart">currentPart</a></p>
						<ul>
							<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L66">core/player.ts:66</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
					<a name="desiredqpm" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagProtected">Protected</span> desiredQPM</h3>
					<div class="tsd-signature tsd-kind-icon">desiredQPM<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
					<aside class="tsd-sources">
						<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#desiredqpm">desiredQPM</a></p>
						<ul>
							<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L70">core/player.ts:70</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
					<a name="outputs" class="tsd-anchor"></a>
					<h3>outputs</h3>
					<div class="tsd-signature tsd-kind-icon">outputs<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">MIDIOutput</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> =&nbsp;[]</span></div>
					<aside class="tsd-sources">
						<ul>
							<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L627">core/player.ts:627</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
					<a name="playclick" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagProtected">Protected</span> play<wbr>Click</h3>
					<div class="tsd-signature tsd-kind-icon">play<wbr>Click<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
					<aside class="tsd-sources">
						<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#playclick">playClick</a></p>
						<ul>
							<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L68">core/player.ts:68</a></li>
						</ul>
					</aside>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
					<a name="scheduledstop" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagProtected">Protected</span> scheduled<wbr>Stop</h3>
					<div class="tsd-signature tsd-kind-icon">scheduled<wbr>Stop<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
					<aside class="tsd-sources">
						<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#scheduledstop">scheduledStop</a></p>
						<ul>
							<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L67">core/player.ts:67</a></li>
						</ul>
					</aside>
				</section>
			</section>
			<section class="tsd-panel-group tsd-member-group ">
				<h2>Methods</h2>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
					<a name="getplaystate" class="tsd-anchor"></a>
					<h3>get<wbr>Play<wbr>State</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
						<li class="tsd-signature tsd-kind-icon">get<wbr>Play<wbr>State<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#getplaystate">getPlayState</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L235">core/player.ts:235</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Returns the playback state of the player, either &quot;started&quot;,
									&quot;stopped&quot;, or &quot;paused&quot;.</p>
								</div>
							</div>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
					<a name="isplaying" class="tsd-anchor"></a>
					<h3>is<wbr>Playing</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
						<li class="tsd-signature tsd-kind-icon">is<wbr>Playing<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#isplaying">isPlaying</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L227">core/player.ts:227</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Returns true iff the player is completely stopped. This will only be
										false after calling stop(), and will be true after calling
									start(), pause() or unpause().</p>
								</div>
							</div>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
					<a name="pause" class="tsd-anchor"></a>
					<h3>pause</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
						<li class="tsd-signature tsd-kind-icon">pause<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#pause">pause</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L210">core/player.ts:210</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Pause playing the currently playing sequence right away. Call unpause()
									to resume.</p>
								</div>
							</div>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-protected">
					<a name="playnote" class="tsd-anchor"></a>
					<h3><span class="tsd-flag ts-flagProtected">Protected</span> play<wbr>Note</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-protected">
						<li class="tsd-signature tsd-kind-icon">play<wbr>Note<span class="tsd-signature-symbol">(</span>time<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, note<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">INote</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Overrides <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#playnote">playNote</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L671">core/player.ts:671</a></li>
								</ul>
							</aside>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>time: <span class="tsd-signature-type">number</span></h5>
								</li>
								<li>
									<h5>note: <span class="tsd-signature-type">INote</span></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
					<a name="playnotedown" class="tsd-anchor"></a>
					<h3>play<wbr>Note<wbr>Down</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
						<li class="tsd-signature tsd-kind-icon">play<wbr>Note<wbr>Down<span class="tsd-signature-symbol">(</span>note<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">INote</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L699">core/player.ts:699</a></li>
								</ul>
							</aside>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>note: <span class="tsd-signature-type">INote</span></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
					<a name="playnoteup" class="tsd-anchor"></a>
					<h3>play<wbr>Note<wbr>Up</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
						<li class="tsd-signature tsd-kind-icon">play<wbr>Note<wbr>Up<span class="tsd-signature-symbol">(</span>note<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">INote</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L713">core/player.ts:713</a></li>
								</ul>
							</aside>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>note: <span class="tsd-signature-type">INote</span></h5>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
					<a name="requestmidiaccess" class="tsd-anchor"></a>
					<h3>requestMIDIAccess</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
						<li class="tsd-signature tsd-kind-icon">requestMIDIAccess<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Object</span><span class="tsd-signature-symbol">&gt;</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L646">core/player.ts:646</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Requests MIDI access from the user, and stores all available MIDI outputs.</p>
								</div>
							</div>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Object</span><span class="tsd-signature-symbol">&gt;</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
					<a name="resume" class="tsd-anchor"></a>
					<h3>resume</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
						<li class="tsd-signature tsd-kind-icon">resume<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#resume">resume</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L218">core/player.ts:218</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Pause playing the currently playing sequence right away. Call resume()
									to resume playing the sequence.</p>
								</div>
							</div>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
					<a name="resumecontext" class="tsd-anchor"></a>
					<h3>resume<wbr>Context</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
						<li class="tsd-signature tsd-kind-icon">resume<wbr>Context<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#resumecontext">resumeContext</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L129">core/player.ts:129</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Resumes the Audio context. Due to autoplay restrictions, you must call
										this function in a click handler (i.e. as a result of a user action) before
										you can start playing audio with a player. This is already done in start(),
										but you might have to call it yourself if you have any deferred/async
									calls.</p>
								</div>
							</div>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
					<a name="settempo" class="tsd-anchor"></a>
					<h3>set<wbr>Tempo</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
						<li class="tsd-signature tsd-kind-icon">set<wbr>Tempo<span class="tsd-signature-symbol">(</span>qpm<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#settempo">setTempo</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L93">core/player.ts:93</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Changes the tempo of the playback.</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>qpm: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>The new qpm to use.</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
					<a name="start" class="tsd-anchor"></a>
					<h3>start</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
						<li class="tsd-signature tsd-kind-icon">start<span class="tsd-signature-symbol">(</span>seq<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">INoteSequence</span>, qpm<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#start">start</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L143">core/player.ts:143</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Starts playing a <code>NoteSequence</code> (either quantized or unquantized), and
									returns a Promise that resolves when it is done playing.</p>
								</div>
							</div>
							<h4 class="tsd-parameters-title">Parameters</h4>
							<ul class="tsd-parameters">
								<li>
									<h5>seq: <span class="tsd-signature-type">INoteSequence</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>The <code>NoteSequence</code> to play.</p>
									</div>
								</li>
								<li>
									<h5><span class="tsd-flag ts-flagOptional">Optional</span> qpm: <span class="tsd-signature-type">number</span></h5>
									<div class="tsd-comment tsd-typography">
										<p>(Optional) If specified, will play back at this qpm. If not
											specified, will use either the qpm specified in the sequence or the
										default of 120. Only valid for quantized sequences.</p>
									</div>
								</li>
							</ul>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4>
							<p>a Promise that resolves when playback is complete.</p>
						</li>
					</ul>
				</section>
				<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
					<a name="stop" class="tsd-anchor"></a>
					<h3>stop</h3>
					<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
						<li class="tsd-signature tsd-kind-icon">stop<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
					</ul>
					<ul class="tsd-descriptions">
						<li class="tsd-description">
							<aside class="tsd-sources">
								<p>Inherited from <a href="_core_player_.baseplayer.html">BasePlayer</a>.<a href="_core_player_.baseplayer.html#stop">stop</a></p>
								<ul>
									<li>Defined in <a href="https://github.com/tensorflow/magenta-js/tree/master/music/src/core/player.ts#L195">core/player.ts:195</a></li>
								</ul>
							</aside>
							<div class="tsd-comment tsd-typography">
								<div class="lead">
									<p>Stop playing the currently playing sequence right away.</p>
								</div>
							</div>
							<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
						</li>
					</ul>
				</section>
			</section>
		</div>
		<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
			<nav class="tsd-navigation primary">
				<ul>
					<li class="globals  ">
						<a href="../globals.html"><em>Globals</em></a>
					</li>
					<li class="current tsd-kind-external-module">
						<a href="../modules/_core_player_.html">"core/player"</a>
					</li>
				</ul>
			</nav>
			<nav class="tsd-navigation secondary menu-sticky">
				<ul class="before-current">
					<li class=" tsd-kind-class tsd-parent-kind-external-module">
						<a href="_core_player_.baseplayer.html" class="tsd-kind-icon">Base<wbr>Player</a>
					</li>
					<li class=" tsd-kind-class tsd-parent-kind-external-module">
						<a href="_core_player_.baseplayercallback.html" class="tsd-kind-icon">Base<wbr>Player<wbr>Callback</a>
					</li>
					<li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-not-exported">
						<a href="_core_player_.drumkit.html" class="tsd-kind-icon">Drum<wbr>Kit</a>
					</li>
				</ul>
				<ul class="current">
					<li class="current tsd-kind-class tsd-parent-kind-external-module">
						<a href="_core_player_.midiplayer.html" class="tsd-kind-icon">MIDIPlayer</a>
						<ul>
							<li class=" tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite">
								<a href="_core_player_.midiplayer.html#constructor" class="tsd-kind-icon">constructor</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class">
								<a href="_core_player_.midiplayer.html#availableoutputs" class="tsd-kind-icon">available<wbr>Outputs</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
								<a href="_core_player_.midiplayer.html#callbackobject" class="tsd-kind-icon">callback<wbr>Object</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
								<a href="_core_player_.midiplayer.html#currentpart" class="tsd-kind-icon">current<wbr>Part</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
								<a href="_core_player_.midiplayer.html#desiredqpm" class="tsd-kind-icon">desiredQPM</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class">
								<a href="_core_player_.midiplayer.html#outputs" class="tsd-kind-icon">outputs</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
								<a href="_core_player_.midiplayer.html#playclick" class="tsd-kind-icon">play<wbr>Click</a>
							</li>
							<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
								<a href="_core_player_.midiplayer.html#scheduledstop" class="tsd-kind-icon">scheduled<wbr>Stop</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
								<a href="_core_player_.midiplayer.html#getplaystate" class="tsd-kind-icon">get<wbr>Play<wbr>State</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
								<a href="_core_player_.midiplayer.html#isplaying" class="tsd-kind-icon">is<wbr>Playing</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
								<a href="_core_player_.midiplayer.html#pause" class="tsd-kind-icon">pause</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-protected">
								<a href="_core_player_.midiplayer.html#playnote" class="tsd-kind-icon">play<wbr>Note</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class">
								<a href="_core_player_.midiplayer.html#playnotedown" class="tsd-kind-icon">play<wbr>Note<wbr>Down</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class">
								<a href="_core_player_.midiplayer.html#playnoteup" class="tsd-kind-icon">play<wbr>Note<wbr>Up</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class">
								<a href="_core_player_.midiplayer.html#requestmidiaccess" class="tsd-kind-icon">requestMIDIAccess</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
								<a href="_core_player_.midiplayer.html#resume" class="tsd-kind-icon">resume</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
								<a href="_core_player_.midiplayer.html#resumecontext" class="tsd-kind-icon">resume<wbr>Context</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
								<a href="_core_player_.midiplayer.html#settempo" class="tsd-kind-icon">set<wbr>Tempo</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
								<a href="_core_player_.midiplayer.html#start" class="tsd-kind-icon">start</a>
							</li>
							<li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
								<a href="_core_player_.midiplayer.html#stop" class="tsd-kind-icon">stop</a>
							</li>
						</ul>
					</li>
				</ul>
				<ul class="after-current">
					<li class=" tsd-kind-class tsd-parent-kind-external-module">
						<a href="_core_player_.player.html" class="tsd-kind-icon">Player</a>
					</li>
					<li class=" tsd-kind-class tsd-parent-kind-external-module">
						<a href="_core_player_.playerwithclick.html" class="tsd-kind-icon">Player<wbr>With<wbr>Click</a>
					</li>
					<li class=" tsd-kind-class tsd-parent-kind-external-module">
						<a href="_core_player_.soundfontplayer.html" class="tsd-kind-icon">Sound<wbr>Font<wbr>Player</a>
					</li>
					<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-not-exported">
						<a href="../modules/_core_player_.html#comparequantizednotes" class="tsd-kind-icon">compare<wbr>Quantized<wbr>Notes</a>
					</li>
				</ul>
			</nav>
		</div>
	</div>
</div>
<footer class="with-border-bottom">
	<div class="container">
		<h2>Legend</h2>
		<div class="tsd-legend-group">
			<ul class="tsd-legend">
				<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
				<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
				<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
				<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
				<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
				<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
				<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
				<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
				<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
				<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
				<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
				<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
				<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
				<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
				<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
				<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
				<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
				<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
				<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
			</ul>
			<ul class="tsd-legend">
				<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
				<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
			</ul>
		</div>
	</div>
</footer>
<div class="container tsd-generator">
	<p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>